package com.ljx.controller;

import com.ljx.entity.Person;
import com.ljx.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version V1.0
 * @author: Ljxpa
 * @date: 2020/04/20 16:50
 * @description:
 */
@RestController
public class HelloController {

	@Autowired
	private PersonService personService;


	@GetMapping("/{id}")
	public ResponseEntity<String> queryOne(@PathVariable("id") Integer id){
		Person person = personService.queryOne(id);


		return ResponseEntity.ok("查询成功"+person.getName());
	}

}
